package com.link2room.optimus.entity;

import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.sql.Time;

/**
 * 集团价格计划
 * Created by sss on 2016/8/25.
 */
@Entity
@Table(name = "l2r_rateplan")
@DynamicInsert
public class L2RRateplan extends BaseRateplan{
    public enum L2RRateplan_{
        rpCode,rpName,pbChannel,breakfast,descript,minAdvHours,maxAdvHours,
        minDays,maxDays,maxRmnum,startTime,endTime,payTime,remark,comsg,pmsRatecode
    }
    /**
     * 价格计划代码
     */
    private String rpCode;
    /**
     * 价格计划名字
     */
    private String rpName;
    /**
     * 发布渠道
     */
    private String pbChannel;
    /**
     * 早餐份数
     */
    private Integer breakfast;
    /**
     * 描述
     */
    private String descript;
    /**
     * 最小提前小时数
     */
    private Integer minAdvHours;
    /**
     * 最大提前小时数
     */
    private Integer maxAdvHours;
    /**
     * 最小连住天数
     */
    private Integer minDays;
    /**
     * 最大连住天数
     */
    private Integer maxDays;
    /**
     * 最大可预订房间数
     */
    private Integer maxRmnum;
    /**
     * 可支付时间
     */
    private Integer payTime;
    /**
     * 备注
     */
    private String remark;
    /**
     * 结账提醒
     */
     private String comsg;
    /**
     * 开始时间
     */
    private Time startTime;
    /**
     * 结束时间
     */
    private Time endTime;
    /**
     * 用券规则：NONE不能用券/ONE一张券/MORE多张券
     */
    private String couponRule;
    /**
     * 使用积分规则
     */
    private String pointRule;
    /**
     * 取消类型
     */
    private String cancelType;
    /**
     * 自定义取消规则
     */
    private String cancelRule;

    @Basic
    @Column(name = "rp_code", nullable = false, length = 32)
    public String getRpCode() {
        return rpCode;
    }

    public void setRpCode(String rpCode) {
        this.rpCode = rpCode;
    }

    @Basic
    @Column(name = "rp_name", nullable = false, length = 32)
    public String getRpName() {
        return rpName;
    }

    public void setRpName(String rpName) {
        this.rpName = rpName;
    }

    @Basic
    @Column(name = "pb_channel", nullable = false, length = 16)
    public String getPbChannel() {
        return pbChannel;
    }

    public void setPbChannel(String pbChannel) {
        this.pbChannel = pbChannel;
    }

    @Basic
    @Column(name = "breakfast", nullable = true)
    public Integer getBreakfast() {
        return breakfast;
    }

    public void setBreakfast(Integer breakfast) {
        this.breakfast = breakfast;
    }

    @Basic
    @Column(name = "descript", nullable = true, length = 128)
    public String getDescript() {
        return descript;
    }

    public void setDescript(String descript) {
        this.descript = descript;
    }

    @Basic
    @Column(name = "min_adv_hours", nullable = true)
    public Integer getMinAdvHours() {
        return minAdvHours;
    }

    public void setMinAdvHours(Integer minAdvHours) {
        this.minAdvHours = minAdvHours;
    }

    @Basic
    @Column(name = "max_adv_hours", nullable = true)
    public Integer getMaxAdvHours() {
        return maxAdvHours;
    }

    public void setMaxAdvHours(Integer maxAdvHours) {
        this.maxAdvHours = maxAdvHours;
    }

    @Basic
    @Column(name = "min_days", nullable = true)
    public Integer getMinDays() {
        return minDays;
    }

    public void setMinDays(Integer minDays) {
        this.minDays = minDays;
    }

    @Basic
    @Column(name = "max_days", nullable = true)
    public Integer getMaxDays() {
        return maxDays;
    }

    public void setMaxDays(Integer maxDays) {
        this.maxDays = maxDays;
    }

    @Basic
    @Column(name = "max_rmnum", nullable = true)
    public Integer getMaxRmnum() {
        return maxRmnum;
    }

    public void setMaxRmnum(Integer maxRmnum) {
        this.maxRmnum = maxRmnum;
    }

    @Basic
    @Column(name = "pay_time", nullable = true)
    public Integer getPayTime() {
        return payTime;
    }

    public void setPayTime(Integer payTime) {
        this.payTime = payTime;
    }

    @Basic
    @Column(name = "remark", nullable = true, length = 255)
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Basic
    @Column(name = "comsg", nullable = true, length = 255)
    public String getComsg() {
        return comsg;
    }

    public void setComsg(String comsg) {
        this.comsg = comsg;
    }

    @Basic
    @Column(name = "start_time", nullable = false)
    public Time getStartTime() {
        return startTime;
    }

    public void setStartTime(Time startTime) {
        this.startTime = startTime;
    }

    @Basic
    @Column(name = "end_time", nullable = false)
    public Time getEndTime() {
        return endTime;
    }

    public void setEndTime(Time endTime) {
        this.endTime = endTime;
    }

    @Basic
    @Column(name = "coupon_rule", nullable = false, length = 16)
    public String getCouponRule() {
        return couponRule;
    }

    public void setCouponRule(String couponRule) {
        this.couponRule = couponRule;
    }

    @Basic
    @Column(name = "point_rule", nullable = false, length = 16)
    public String getPointRule() {
        return pointRule;
    }

    public void setPointRule(String pointRule) {
        this.pointRule = pointRule;
    }

    @Basic
    @Column(name = "cancel_type", nullable = true, length = 16)
    public String getCancelType() {
        return cancelType;
    }

    public void setCancelType(String cancelType) {
        this.cancelType = cancelType;
    }

    @Basic
    @Column(name = "cancel_rule", nullable = true, length = 255)
    public String getCancelRule() {
        return cancelRule;
    }

    public void setCancelRule(String cancelRule) {
        this.cancelRule = cancelRule;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;

        L2RRateplan that = (L2RRateplan) o;

        if (rpCode != null ? !rpCode.equals(that.rpCode) : that.rpCode != null) return false;
        if (rpName != null ? !rpName.equals(that.rpName) : that.rpName != null) return false;
        if (pbChannel != null ? !pbChannel.equals(that.pbChannel) : that.pbChannel != null) return false;
        if (breakfast != null ? !breakfast.equals(that.breakfast) : that.breakfast != null) return false;
        if (descript != null ? !descript.equals(that.descript) : that.descript != null) return false;
        if (minAdvHours != null ? !minAdvHours.equals(that.minAdvHours) : that.minAdvHours != null) return false;
        if (maxAdvHours != null ? !maxAdvHours.equals(that.maxAdvHours) : that.maxAdvHours != null) return false;
        if (minDays != null ? !minDays.equals(that.minDays) : that.minDays != null) return false;
        if (maxDays != null ? !maxDays.equals(that.maxDays) : that.maxDays != null) return false;
        if (maxRmnum != null ? !maxRmnum.equals(that.maxRmnum) : that.maxRmnum != null) return false;
        if (payTime != null ? !payTime.equals(that.payTime) : that.payTime != null) return false;
        if (remark != null ? !remark.equals(that.remark) : that.remark != null) return false;
        if (comsg != null ? !comsg.equals(that.comsg) : that.comsg != null) return false;
        if (startTime != null ? !startTime.equals(that.startTime) : that.startTime != null) return false;
        if (endTime != null ? !endTime.equals(that.endTime) : that.endTime != null) return false;
        if (couponRule != null ? !couponRule.equals(that.couponRule) : that.couponRule != null) return false;
        return pointRule != null ? pointRule.equals(that.pointRule) : that.pointRule == null;

    }

    @Override
    public int hashCode() {
        int result = super.hashCode();
        result = 31 * result + (rpCode != null ? rpCode.hashCode() : 0);
        result = 31 * result + (rpName != null ? rpName.hashCode() : 0);
        result = 31 * result + (pbChannel != null ? pbChannel.hashCode() : 0);
        result = 31 * result + (breakfast != null ? breakfast.hashCode() : 0);
        result = 31 * result + (descript != null ? descript.hashCode() : 0);
        result = 31 * result + (minAdvHours != null ? minAdvHours.hashCode() : 0);
        result = 31 * result + (maxAdvHours != null ? maxAdvHours.hashCode() : 0);
        result = 31 * result + (minDays != null ? minDays.hashCode() : 0);
        result = 31 * result + (maxDays != null ? maxDays.hashCode() : 0);
        result = 31 * result + (maxRmnum != null ? maxRmnum.hashCode() : 0);
        result = 31 * result + (payTime != null ? payTime.hashCode() : 0);
        result = 31 * result + (remark != null ? remark.hashCode() : 0);
        result = 31 * result + (comsg != null ? comsg.hashCode() : 0);
        result = 31 * result + (startTime != null ? startTime.hashCode() : 0);
        result = 31 * result + (endTime != null ? endTime.hashCode() : 0);
        result = 31 * result + (couponRule != null ? couponRule.hashCode() : 0);
        result = 31 * result + (pointRule != null ? pointRule.hashCode() : 0);
        return result;
    }
}
